<template>
	<view class="page">
		<view class="record">
			<view class="record-item" v-for="item in data.list" :key="item.id">
				<view class="record-info">
					<view class="amount">
						{{t('account.withdraw.amount')}}：{{item.balance}}
					</view>
					<view>
						{{t('account.withdraw.w_currency')}}：{{proxy.$util.getCurrencyType(item.currencie_id)}}
					</view>
					<view>
						{{t('account.withdraw.w_address')}}：{{item.address}}
					</view>
					<view>
						{{t('account.withdraw.records.w_time')}}：{{item.created_at}}
					</view>
				</view>
				<view class="record-status">
					{{t(`account.withdraw.records.status_${item.status}`)}}
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	import {
		t
	} from '@/locale/index'
	import {
		onLoad
	} from "@dcloudio/uni-app";
	const {
		proxy
	} = getCurrentInstance();

	const data = ref({
		list: [],
	});

	const getList = () => {
		proxy.$http.get('withdraw').then(res => {
			console.log(res, "提现记录");
			data.value.list = res.data;
		})
	};



	onLoad(() => {
		getList();
	});
</script>

<style scoped lang="scss">
	.record {
		&-item {
			display: flex;
			align-items: center;
			justify-content: space-between;
			background-color: #fff;
			margin-top: 10rpx;
			padding: 20rpx 30rpx;
			color: #999;
			font-size: 24rpx;

			.amount {
				color: #333;
				font-size: 28rpx;
			}
		}
	}
</style>